 
//     Copyright (c) Narin Persad. All rights reserved.The MIT License (MIT)

// Copyright (c) 2014 Narin Persad

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
 
//-----------------------------------------------------------------------


using MvcSimpleQuery.Events;
using System;
using System.Linq.Expressions;
using System.Web;
using System.Web.Mvc;
namespace MvcSimpleQuery.Html
{
    /// <summary>
    /// IHtmlSimpleQueryOptions is used to restrict/control the methods that 
    /// are available through the HtmlHelper
    /// </summary>
    /// <typeparam name="T">The class that will be used to verify the Fields are legitimate</typeparam>
    public interface IHtmlSimpleQueryOptions : IHtmlString 
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fieldBuilder">an action that takes a FieldBuilder object</param>
        /// <returns></returns>
        /// <remarks>use the fieldBuilder action to add fields to the SimpleQuery object</remarks>
        IHtmlSimpleQueryOptions Fields<X>(Action<FieldBuilder<X>> fieldBuilder) where X : class;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="name">The name to call the Simple Query javascript object</param>
        /// <returns></returns>
        IHtmlSimpleQueryOptions Named(string name);

        /// <summary>
        /// Javascript callback evens
        /// </summary>
        /// <param name="sevb"></param>
        /// <returns></returns>
        IHtmlSimpleQueryOptions Events(Action<ISimpleQueryEventBuilder> sevb);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="autodropdown">True/False to specifiy whether fields are text-predicted</param>
        /// <returns></returns>
        IHtmlSimpleQueryOptions AutoDrop(bool autodropdown);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="urlhepher"></param>
        /// <returns></returns>
        IHtmlSimpleQueryOptions Read(Expression<Func<UrlHelper,string>> urlhepher);
    }
}
